package ch14;

import java.util.Scanner;

/*3：输入两个整数，输出他们 & |  ^的结果。*/
public class ch14exer3 {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        System.out.println("第一个数：");
        int n=scanner.nextInt();
        System.out.println(n+"的二进制为："+Integer.toBinaryString(n));
        System.out.println("第二个数：");
        int m=scanner.nextInt();
        System.out.println(m+"的二进制为："+Integer.toBinaryString(m));

        System.out.println("&="+(n&m));
        System.out.println("|="+(n|m));
        System.out.println("^="+(n^m));


    }
}
